package com.myblog.mapper;

import com.myblog.model.PrivateWord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PrivateWordMapper {
    @Select("select * from privateword where publisherId = #{id}")
    List<PrivateWord> selectPWByUserId(String id);

    @Insert("insert  into privateword(privateWord,publisherId,publisherDate) values (#{privateWord},#{publisherId},#{publisherDate})")
    void addPrivateWord(PrivateWord privateWord);

    @Select("select * from privateword")
    List<PrivateWord> selectAllPW();
}
